﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ResourcesOverMvc.Web.Mvc;
using Samples.WebService.Models;

namespace Samples.WebService.Controllers
{
    public class HomeController : Controller, IAllowedVerbs
    {
        public string GetAllowedVerbs(ActionExecutedContext actionExecutedContext) { return "GET"; }

        [HttpGet]
        public ActionResult Index()
        {
            var resources = new List<Resource>
                                {
                                    new Resource
                                        {
                                            FriendlyName = "Categories",
                                            Id = "categories",
                                            Uri =
                                                Url.Action("Index", "Categories", 
                                                null, Request.Url.Scheme, string.Empty)
                                        },
                                    new Resource
                                        {
                                            FriendlyName = "Products",
                                            Id = "products",
                                            Uri =
                                                Url.Action("Index", "Products", 
                                                null, Request.Url.Scheme, string.Empty)
                                        }
                                };

            return View(resources);
        }
    }
}
